package com.keepmoving.service.impl;

import com.keepmoving.dao.PhysicalDao;
import com.keepmoving.po.Physical;
import com.keepmoving.service.PhysicalService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 教练指标业务逻辑实现类
 * @author gyy
 */
@Service
public class PhysicalServiceImpl implements PhysicalService {
    @Resource
    PhysicalDao physicalDao;
    @Override
    public List<Physical> piephysical(int pId) {
        return physicalDao.piephysical(pId);
    }

    @Override
    public List<Integer> findCulms(int pId) {
        List<Integer> values = new ArrayList<>();
        List<Physical> physicals=physicalDao.piephysical(pId);
        for (Physical physical:physicals ){
            values.add(physical.getPower());
            values.add(physical.getEndurance());
            values.add(physical.getSensitivity());
            values.add(physical.getCoordinate());
            values.add(physical.getExplosive());
        }
        return values;
    }
}
